package defectsim;

public class DefectFactory {
	
	public enum DefectType {
		EdgeDislocation,
		ScrewDislocation,
		DislocationSource,
		Obstacle
	}

	public static DefectAgent createDefect(DefectType dType) {
		switch (dType) {
		case EdgeDislocation:
			return new EdgeDislocation();
		case ScrewDislocation:
			return new ScrewDislocation();
		case DislocationSource:
			return new DislocationSource();
		}
		throw new IllegalArgumentException("The defect type " + dType + " is not recognized.");
	}
}
